package com.eastcom.bm.atom;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;



@Entity
@Table(name = "QA_KPI_DEFINE")
public class Atom_KpiDefine implements Serializable{
	
	private String id;
	
	private String cn_name;
	
	private String kpiId;
	
	//private String datasetId;
	
	private Atom_DatasetDefine datasetDefine;
	
	private String validationType;
	
	private Double baselineValue;
	
	private Double deviationUp;
	
	private Double deviationDown;
	
	private Double threadHoldUp;
	
	private Double threadHoldDown;

	private String calendarPolicyUUID="002";
	
	private String columnName;

	@Id
	@Column(name="ID")
	@GenericGenerator(name = "KpiDefine-uuid", strategy = "uuid")
	@GeneratedValue(generator = "KpiDefine-uuid")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	@Column(name="COLUMN_NAME")
	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}
	
	@Column(name="BASELINE_VALUE")
	public Double getBaselineValue() {
		return baselineValue;
	}

	public void setBaselineValue(Double baselineValue) {
		this.baselineValue = baselineValue;
	}

	@Column(name="NAME_CN")
	public String getCn_name() {
		return cn_name;
	}

	public void setCn_name(String cn_name) {
		this.cn_name = cn_name;
	}

	/*
	@Column(name="DATASET_ID")
	public String getDatasetId() {
		return datasetId;
	}

	public void setDatasetId(String datasetId) {
		this.datasetId = datasetId;
	}
    */
	
	@Column(name="DEVIATION_DOWN")
	public Double getDeviationDown() {
		return deviationDown;
	}

	public void setDeviationDown(Double deviationDown) {
		this.deviationDown = deviationDown;
	}

	@Column(name="DEVIATION_UP")
	public Double getDeviationUp() {
		return deviationUp;
	}

	public void setDeviationUp(Double deviationUp) {
		this.deviationUp = deviationUp;
	}

	@Column(name="THREADHOLD_DOWN")
	public Double getThreadHoldDown() {
		return threadHoldDown;
	}

	public void setThreadHoldDown(Double threadHoldDown) {
		this.threadHoldDown = threadHoldDown;
	}

	@Column(name="THREADHOLD_UP")
	public Double getThreadHoldUp() {
		return threadHoldUp;
	}

	public void setThreadHoldUp(Double threadHoldUp) {
		this.threadHoldUp = threadHoldUp;
	}

	@Column(name="VALIDATION_TYPE")
	public String getValidationType() {
		return validationType;
	}

	public void setValidationType(String validationType) {
		this.validationType = validationType;
	}

	@Column(name="KPI_ID")
	public String getKpiId() {
		return kpiId;
	}

	public void setKpiId(String kpiId) {
		this.kpiId = kpiId;
	}

	@Column(name="CALENDAR_POLICY_UUID")
	public String getCalendarPolicyUUID() {
		return calendarPolicyUUID;
	}

	public void setCalendarPolicyUUID(String calendarPolicyUUID) {
		this.calendarPolicyUUID = calendarPolicyUUID;
	}
	
	@ManyToOne(fetch=FetchType.LAZY,cascade={CascadeType.PERSIST})
	@JoinColumn(name="DATASET_ID",referencedColumnName="ID")
	public Atom_DatasetDefine getDatasetDefine() {
		return datasetDefine;
	}

	public void setDatasetDefine(Atom_DatasetDefine datasetDefine) {
		this.datasetDefine = datasetDefine;
	}
	
}
